package com.yumis.service.modules.car.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yumis.service.common.enums.HttpState;
import com.yumis.service.common.exception.GlobalException;
import com.yumis.service.common.vo.Page;
import com.yumis.service.common.vo.Response;
import com.yumis.service.model.pojo.CarAscription;
import com.yumis.service.model.pojo.CarBrand;
import com.yumis.service.modules.car.mapper.CarAscriptionMapper;
import com.yumis.service.modules.car.service.CarAscriptionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class CarAscriptionServiceImpl implements CarAscriptionService {
    @Resource
    private CarAscriptionMapper carAscriptionMapper;
    @Override
    public List<CarAscription> queryCarAscription() {
        List<CarAscription> carAscriptionList=carAscriptionMapper.selectAll();
        if (CollectionUtils.isEmpty(carAscriptionList)){
            throw new GlobalException(Response.buildResponse(HttpState.DATA_NOT_FOUNT));
        }
        return  carAscriptionList;
    }
}
